package com.zmn.plat.business.impl.user;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zmn.common.dictionary.GlobalDict;
import com.zmn.plat.business.interfaces.user.CustomerBService;
import com.zmn.plat.model.entity.user.Customer;
import com.zmn.plat.services.interfaces.user.CustomerService;

/**
 * Creator: nowind
 * 
 * @since 2018/7/13 13:55
 */
@Service
public class CustomerBServiceImpl implements CustomerBService {

    @Resource
    private CustomerService customerService;

    @Override
    public Integer updateByKey(Customer customer) {
        return customerService.updateByKey(customer);
    }

    @Override
    public Integer insert(Customer customer) {
        customer.setStatus(GlobalDict.STATUS_ENABLE);

        int pos = customerService.insert(customer);
        return pos > 0 ? customer.getCustomerId() : 0;
    }
}
